package com.home766.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import net.biz.entity.Admin;
import net.biz.entity.Order;
import net.biz.entity.OrderEntity;

import javax.persistence.*;
import java.util.List;

/**
 * Entity - 门店
 * 
 * @author Ricky
 * @version 1.0
 */
@Entity
@Table(name = "766_shops")
@SequenceGenerator(name = "sequenceGenerator", sequenceName = "766_shops_sequence")
public class Shops extends OrderEntity {
	
	private static final long serialVersionUID = -1307743303786909390L;
	/*门店名称 */
	private String shopsName;
	/*门店编码*/
	private String shopsCode;
	/*门店地址 */
	private String address;
	/*门店GPS名称 */
	private String gpsAddress;
	/*门店坐标X */
	private Float gpsX;
	/*门店坐标Y */
	private Float gpsY;
	/*联系人名称 */
	private String contactP;
	/*联系人电话 */
	private String contactT;
	/*所属省份Id */
	private Long provinceId;
	/*所属城市Id */
	private Long cityId;
	/*区，县（保存）*/
	private Long areaId;
	/*门店类型*/
	private Long storeType;
	private String storeTypeName;
	/*纳税人类别*/
	private Long taxpayerType;
	private String taxpayerTypeName;
	/*门店规模*/
	private Long storeScale;
	private String storeScaleName;
	/*经营范围*/
	private String ranges;
	/*服务次数*/
	private Long serviceFrequency;
	/**服务次数--单品*/
	private Long ordersFrequency;
	/*区域全称*/
	private String fullName;
	/*服务区域名称*/
	private String areaName;
	/*admin*/
	private Admin admin;
	/*门店账号*/
	private String userName;
	/*门店性质,0下单门店,1服务门店,2两者*/
	private Long shopsNature;
	/*刪除0，未刪除，1刪除*/
	private Integer deleteState;
	/*门店等级*/
	private Long shopsLevel;
	private String shopsLevelName;
	/*A级门店*/
	private Long shopsA;
	/**
	 * 下单订单
	 */
	private List<Order> orders;
	/**
	 * 服务订单
	 */
	private List<Order> serviceOrders;
	
	@JsonProperty
	@Column(name ="shops_name")
	public String getShopsName() {
		return shopsName;
	}

	public void setShopsName(String shopsName) {
		this.shopsName = shopsName;
	}
	@Column(name ="address")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	@Column(name ="gps_address")
	public String getGpsAddress() {
		return gpsAddress;
	}

	public void setGpsAddress(String gpsAddress) {
		this.gpsAddress = gpsAddress;
	}
	@Column(name ="gpsx")
	public Float getGpsX() {
		return gpsX;
	}

	public void setGpsX(Float gpsX) {
		this.gpsX = gpsX;
	}
	@Column(name ="gpsy")
	public Float getGpsY() {
		return gpsY;
	}

	public void setGpsY(Float gpsY) {
		this.gpsY = gpsY;
	}
	@Column(name ="contact_p")
	public String getContactP() {
		return contactP;
	}

	public void setContactP(String contactP) {
		this.contactP = contactP;
	}
	@Column(name ="contact_t")
	public String getContactT() {
		return contactT;
	}

	public void setContactT(String contactT) {
		this.contactT = contactT;
	}
	@Column(name ="province_id")
	public Long getProvinceId() {
		return provinceId;
	}

	public void setProvinceId(Long provinceId) {
		this.provinceId = provinceId;
	}
	@Column(name ="city_id")
	public Long getCityId() {
		return cityId;
	}

	public void setCityId(Long cityId) {
		this.cityId = cityId;
	}
	@Column(name ="area_id")
	public Long getAreaId() {
		return areaId;
	}

	public void setAreaId(Long areaId) {
		this.areaId = areaId;
	}
	@Column(name ="store_type")
	public Long getStoreType() {
		return storeType;
	}

	public void setStoreType(Long storeType) {
		this.storeType = storeType;
	}
	@Column(name ="taxpayer_type")
	public Long getTaxpayerType() {
		return taxpayerType;
	}

	public void setTaxpayerType(Long taxpayerType) {
		this.taxpayerType = taxpayerType;
	}
	@Column(name ="store_scale")
	public Long getStoreScale() {
		return storeScale;
	}

	public void setStoreScale(Long storeScale) {
		this.storeScale = storeScale;
	}
	@Column(name ="ranges")
	public String getRanges() {
		return ranges;
	}

	public void setRanges(String ranges) {
		this.ranges = ranges;
	}
	@Column(name ="full_name")
	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}
	@Column(name ="shops_code")
	public String getShopsCode() {
		return shopsCode;
	}

	public void setShopsCode(String shopsCode) {
		this.shopsCode = shopsCode;
	}
	@Column(name ="service_frequency")
	public Long getServiceFrequency() {
		return serviceFrequency;
	}

	public void setServiceFrequency(Long serviceFrequency) {
		this.serviceFrequency = serviceFrequency;
	}
	@OneToMany(mappedBy = "shops", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
	public List<Order> getOrders() {
		return orders;
	}

	public void setOrders(List<Order> orders) {
		this.orders = orders;
	}
	@OneToMany(mappedBy = "serviceShops", fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
	public List<Order> getServiceOrders() {
		return serviceOrders;
	}

	public void setServiceOrders(List<Order> serviceOrders) {
		this.serviceOrders = serviceOrders;
	}
	@Transient
	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}
	@Transient
	public String getStoreTypeName() {
		return storeTypeName;
	}

	public void setStoreTypeName(String storeTypeName) {
		this.storeTypeName = storeTypeName;
	}
	@Transient
	public String getTaxpayerTypeName() {
		return taxpayerTypeName;
	}

	public void setTaxpayerTypeName(String taxpayerTypeName) {
		this.taxpayerTypeName = taxpayerTypeName;
	}
	@Transient
	public String getStoreScaleName() {
		return storeScaleName;
	}

	public void setStoreScaleName(String storeScaleName) {
		this.storeScaleName = storeScaleName;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@OneToOne(cascade=CascadeType.REMOVE,fetch=FetchType.LAZY,targetEntity=Admin.class)
	@JoinColumn(name="admin")
	public Admin getAdmin() {
		return admin;
	}

	public void setAdmin(Admin admin) {
		this.admin = admin;
	}

	public Long getOrdersFrequency() {
		return ordersFrequency;
	}

	public void setOrdersFrequency(Long ordersFrequency) {
		this.ordersFrequency = ordersFrequency;
	}
	@Transient
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}
	@Column(name="shops_nature")
	public Long getShopsNature() {
		return shopsNature;
	}

	public void setShopsNature(Long shopsNature) {
		this.shopsNature = shopsNature;
	}
	@Column(name="delete_state")
	public Integer getDeleteState() {
		return deleteState;
	}

	public void setDeleteState(Integer deleteState) {
		this.deleteState = deleteState;
	}
	@Column(name="shops_level")
	public Long getShopsLevel() {
		return shopsLevel;
	}

	public void setShopsLevel(Long shopsLevel) {
		this.shopsLevel = shopsLevel;
	}
	@Transient
	public String getShopsLevelName() {
		return shopsLevelName;
	}

	public void setShopsLevelName(String shopsLevelName) {
		this.shopsLevelName = shopsLevelName;
	}
	@Column(name="shops_a")
	public Long getShopsA() {
		return shopsA;
	}
	public void setShopsA(Long shopsA) {
		this.shopsA = shopsA;
	}

}
